home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-12 | 1.3 KB | 61 lines |
- /*
- * Copyright(C) 1996 Sony Corporation. All rights reserved.
- */
-
- import vrml.*;
- import vrml.field.*;
- import vrml.node.*;
- import java.util.*;
- import vs.*;
-
- public class lights extends Script{
- /* Node */
- SFNode SwNode;
-
- /* EventOut */
- //SFBool SwTimeSensorEnabled;
- SFTime SwTimeSensorStartTime;
-
- public void initialize() {
- /* Node */
- SwNode = (SFNode) getField( "SwNode" );
-
- /* EventOut */
- //SwTimeSensorEnabled = (SFBool) getEventOut( "SwTimeSensorEnabled" );
- SwTimeSensorStartTime = (SFTime) getEventOut( "SwTimeSensorStartTime" );
- }
-
- public void processEvent(Event e) {
- String name = e.getName () ;
-
- if(name.equals("SwTouchSensorIsActive")) { SwTouchSensorIsActive(e); }
- if(name.equals("SwShareTouched")){ SwShareTouched(e); }
- }
-
- public void SwTouchSensorIsActive(Event e) {
- double time = e.getTimeStamp();
- ConstSFBool mouse_down = (ConstSFBool)e.getValue();
-
- if (mouse_down.getValue()) return; /* mouseDown */
-
- SwStart( time );
- Vscp.sendApplSpecificMsgWithDist( SwNode, "SwShareTouched", "void", Vscp.allClientsExceptMe );
- }
-
- public void SwShareTouched(Event e) {
- double time = e.getTimeStamp();
-
- SwStart( time );
-
- }
-
- public void SwStart ( double time ) {
-
- SwTimeSensorStartTime.setValue( time );
-
- }
- }
-
-
-